package com.zf.yichat.service;

import com.zf.yichat.dto.PacketInfoDto;
import com.zf.yichat.dto.PacketReceiveDto;
import com.zf.yichat.dto.PacketReceiveInfoDto;
import com.zf.yichat.dto.PacketSendInfoDto;
import com.zf.yichat.model.Packet;
import com.zf.yichat.model.PacketMixuan;
import com.zf.yichat.model.PacketSale;
import com.zf.yichat.utils.response.FsPage;
import com.zf.yichat.utils.response.FsResponse;
import com.zf.yichat.vo.PacketType;

import java.math.BigDecimal;
import java.util.List;

/**
 * 一句话描述功能
 *
 * @author fengsong
 * @date create in 15:08 2019/6/11 2019
 */
public interface PacketService {

    Packet create(boolean isSingle, Integer srcType, Long userId, String password, Long receiveUserId, Integer num, BigDecimal money, String content, Long groupId, List<BigDecimal> packetList);

    Packet selectById(Long id);

    FsResponse createManghe(Long userId, String password, BigDecimal money, Long orderId);

    FsResponse createMangheIntegral(Integer type,Long userId, String password, Integer integral, Long orderId);

    /**
     * 领取红包
     *
     * @param packetId 红包
     * @param userId   领取人
     */
    FsResponse receivePacket(Long packetId, Long userId) throws Exception;

    /**
     * 用户领取红包（优化）
     * @param packetId
     * @param userId
     * @return
     */
    FsResponse receivePacketOptimize(Long packetId, Long userId) throws Exception;

    FsResponse receivePacketTest(Long packetId, Long userId) throws Exception;
    /**
     * 红包领取信息
     *
     * @param packetId 红包ID
     */
    PacketInfoDto selectListTest(Long packetId, Long userId) throws Exception;
    /**
     * 红包领取信息
     *
     * @param packetId 红包ID
     */
    PacketInfoDto selectListTest2222(Long packetId, Long userId) throws Exception;
    /**
     * 红包详情
     *
     * @param packetId 红包ID
     */
    PacketInfoDto detailWillDetele(Long packetId, Long userId) throws Exception;
    /**
     * 领取红包
     *
     * @param packetId 红包
     * @param userId   领取人
     */
    FsResponse receiveWillDetele(Long packetId, Long userId) throws Exception;
    /**
     * 红包详情
     *
     * @param packetId 红包ID
     */
    PacketInfoDto packetDtail(Long packetId, Long userId) throws Exception;

    /**
     * 红包详情（优化）
     * @param packetId
     * @param userId
     * @return
     * @throws Exception
     */
    PacketInfoDto packetDetailOptimize(Long packetId, Long userId) throws Exception;

    /**
     * 红包领取信息
     **/
    PacketSendInfoDto countSendMoney(PacketType type, Long userId);

    PacketReceiveInfoDto countReceiveMoney(PacketType type, Long userId);

    FsResponse selectSendList(FsPage page, PacketType type, Long userId);

    FsResponse selectReceiveList(FsPage page, PacketType type, Long userId);

    FsResponse selectSaleSendList(FsPage page, Long userId);

    FsResponse selectMixuanSendList(FsPage page, Long userId);

    FsResponse selectSaleReceiveList(FsPage page, Long userId);

    FsResponse selectSaleReceiveMemberList(FsPage page, Long packetId, Long userId);

    void packetTimeoutBack();

    void packetSaleAddForSystem();

    void packetVideoGiftBySystem();

    //    void packetSaleInitForSystem();

    FsResponse createSale(Long userId, BigDecimal money, Integer num, String name, String content, String imgs, String video, String thumbnail, Integer contactStatus, String linkUrl, Integer linkUrlStatus, String location, BigDecimal longitude, BigDecimal latitude, Integer limitDistance, String question, String answer, String tip, Integer type);

    FsResponse createMixuan(Long userId, PacketMixuan mixuan);

    /**
     * 营销红包拒绝后再通过
     *
     * @param packetSale
     * @return
     */
    FsResponse createSaleAgain(PacketSale packetSale);

    /**
     * 营销红包审核通过
     *
     * @param packetSale
     * @return
     */
    FsResponse createSaleSuccess(PacketSale packetSale);

    /**
     * 营销红包审核不通过-退回
     *
     * @param packetSale
     * @return
     */
    FsResponse createSaleFail(PacketSale packetSale);

    /**
     * 营销红包审核通过
     *
     * @param packetSale
     * @return
     */
    FsResponse createMixuanSuccess(PacketMixuan packetSale);

    /**
     * 营销红包审核不通过-退回
     *
     * @param packetSale
     * @return
     */
    FsResponse createMixuanFail(PacketMixuan packetSale);

    FsResponse detailSale(Long packetId, Long userId);

    FsResponse detailMixuan(Long packetId, Long userId);

    FsResponse terminateSale(Long packetId, Long userId);

    FsResponse terminateMixuan(Long packetId, Long userId);

    FsResponse terminateMixuanAdmin(Long packetId);

    FsResponse terminateSaleByAdmin(Long packetId);

    FsResponse toggleSale(Long packetId, Long userId);

    FsResponse toggleMixuan(Long packetId, Long userId);

    FsResponse createMixuanAgain(PacketMixuan mixuan);

    FsResponse toggleMixuanAdmin(Long packetId);

    FsResponse toggleSaleAdmin(Long packetId);

    FsResponse receiveSale(Long packetId, Long userId, BigDecimal longitiude, BigDecimal latitude);

    FsResponse receiveMixuan(Long packetId, Long userId, BigDecimal longitiude, BigDecimal latitude);

    FsResponse giveSale(Long packetId, Long userId, Long ownerUserId);

    FsResponse saleList(Integer pageNo, Integer pageSize, Long userId, Integer type, Long packetId, BigDecimal longitude, BigDecimal latitude);

    FsResponse mixuanList(FsPage page, Long userId);

    FsResponse mixuanDaily();

    FsResponse mixuanApplyList(FsPage page, Long userId, Long packetId);

    /**
     * 营销红包领取信息
     **/
    PacketSendInfoDto countSaleSendMoney(Long userId);

    PacketReceiveInfoDto countSaleReceiveMoney(Long userId);

    /**
     * 退群检查
     */
    void quitGroupSale(Long userId, Integer groupId);

    FsResponse saleAuth(Long userId, Integer groupId);

    void viewSale(Long userId, Long packetId);

    FsResponse saleChartList(Long userId);

    FsResponse saleChartList2(Long userId);

    FsResponse applyVideoPacket(Long userId);

    FsResponse receiveVideoPacket(Long userId);

    FsResponse receiveVipPacket(Long userId);

    /**
     * 根据红包ID查询领取列表
     * @param packetId
     * @return
     */
    List<PacketReceiveDto> receiveList(Long packetId);

}
